package com.schoolgard.entitybean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Terminal entity. 
 * @author luoyegang
 */
@Entity
@Table(name = "TERMINAL")
public class Terminal implements java.io.Serializable {

	// Fields

	private String guid;
	private Params params;
	private HdType hdType;
	private Device device;
	private String name;
	private String domain;
	private String maintainStatus;
	private int channelNo;
	/*private Set<ParamCamera> paramCameras = new HashSet<ParamCamera>(0);
	private Set<ParamAccess> paramAccesses = new HashSet<ParamAccess>(0);
	private Set<CardLog> cardLogs = new HashSet<CardLog>(0);
	private Set<PictureLog> pictureLogs = new HashSet<PictureLog>(0);*/
	@Id
	@Column(name = "GUID", unique = true, nullable = false, length = 64)
	public String getGuid() {
		return this.guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "PARAMS_ID", nullable = false)
	public Params getParams() {
		return this.params;
	}

	public void setParams(Params params) {
		this.params = params;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "HD_TYPE_ID", nullable = false)
	public HdType getHdType() {
		return this.hdType;
	}

	public void setHdType(HdType hdType) {
		this.hdType = hdType;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "DEVICE_GUID", nullable = false)
	public Device getDevice() {
		return this.device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}

	@Column(name = "NAME", length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "DOMAIN", length = 256)
	public String getDomain() {
		return this.domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	@Column(name = "MAINTAIN_STATUS")
	public String getMaintainStatus() {
		return this.maintainStatus;
	}

	public void setMaintainStatus(String maintainStatus) {
		this.maintainStatus = maintainStatus;
	}

	@Column(name = "CHANNEL_NO", precision = 2, scale = 0)
	public int getChannelNo() {
		return this.channelNo;
	}

	public void setChannelNo(int channelNo) {
		this.channelNo = channelNo;
	}

	/*@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "terminal")
	public Set<ParamCamera> getParamCameras() {
		return this.paramCameras;
	}

	public void setParamCameras(Set<ParamCamera> paramCameras) {
		this.paramCameras = paramCameras;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "terminal")
	public Set<ParamAccess> getParamAccesses() {
		return this.paramAccesses;
	}

	public void setParamAccesses(Set<ParamAccess> paramAccesses) {
		this.paramAccesses = paramAccesses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "terminal")
	public Set<CardLog> getCardLogs() {
		return this.cardLogs;
	}

	public void setCardLogs(Set<CardLog> cardLogs) {
		this.cardLogs = cardLogs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "terminal")
	public Set<PictureLog> getPictureLogs() {
		return this.pictureLogs;
	}

	public void setPictureLogs(Set<PictureLog> pictureLogs) {
		this.pictureLogs = pictureLogs;
	}*/

}